import axios from 'axios'
// import config from './config.js'
// 获取酒店列表
function hotelList(){
  return new Promise(
    function(resolve,reject){
      axios.get("/location/lists").then(result=>{
        resolve(result.data)
      })
  })
}

// 分页查询获取用户列表
function hotelPage(params){
  return new Promise(
    function(resolve,reject){
      axios.get(`/location/lists?page_num=${params.currentPage}&page_size=${params.pageSize}`).then(result=>{
        resolve(result.data)
      })
  })
}
// 搜索酒店
function searchHotel(params){
  return new Promise(function(resolve,reject){
    axios.get(`/location/lists/${params}`).then(result=>resolve(result.data))
  })
  
}
// 修改酒店信息
function editHotel(params){
  return new Promise(function(resolve,reject){
    axios.put("/location/edit",params).then(result=>resolve(result.data))
  })
  
}
export {
  hotelList,
  hotelPage,
  searchHotel,
  editHotel
}